package cn.cc.goods.controller.controller;

import cn.cc.common.beanCopy.utils.BeanCopierUtil;
import cn.cc.common.result.utils.RestResult;
import cn.cc.goods.controller.dto.AddGoodsSkuDTO;
import cn.cc.goods.service.GoodsSkuService;
import cn.cc.goods.service.bo.AddGoodsSkuBO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: smail-mi-cloud
 * @description:
 * @author: Mr.WuChao
 * @create: 2021-07-16 18:13
 **/
@RestController
@RequestMapping("/goodSku")
public class GoodsSkuController {
    @Autowired
    private GoodsSkuService skuService;

    @PostMapping("/addSku")
    public RestResult<Void> addSku(AddGoodsSkuDTO skuDTO) {
        AddGoodsSkuBO goodsSkuBO = BeanCopierUtil.copyObj(skuDTO, AddGoodsSkuBO.class);
        RestResult<Void> voidRestResult = skuService.addGoodsSku(goodsSkuBO);
        return new RestResult<>();
    }
}
